<include file="Public:header" />
<!--主体内容-->
<style>

    #estate_id{float: left;}

</style>
<!--左边-->
<div class="centent_box">
    <include file="Public:left" />
    <!--右边-->
    <div class="centent_right_box">
        <div class="centent_right rightCon">
            <div class="Mtitle">
                <ul>
                    <li class="on"><span>客源详情</span></li>
                </ul>
                <div class="rightWord"><a href="{:U('Article/index')}">客源管理</a> &gt;&gt; 客源详情</div>
            </div>
            <form id="info_form" action="{:U('Cust/edit')}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$info.id}">
                <div class="con_div">
                    <ul class="formList width2 list_ul">
                        <li>基本信息</li>
                        <li>
                            <label><span style="color:Red">*</span>类型：</label>
                            <select name="data[demand]" class="selectStyle">
                                <option value="">请选择</option>
                                <option value="1" <php>if(1==$info['demand']){</php> selected="selected" <php>}</php>>求购</option>
                                <option value="2" <php>if(2==$info['demand']){</php> selected="selected" <php>}</php>>求租</option>
                            </select>
                        </li>
                        <li>
                            <label><span style="color:Red">*</span>联系人：</label>
                            <input type="text" class="inputStyle width2" name="data[title]" maxlength="10" value={$info.title}>
                        </li>
                        <li>
                            <label>性别：</label>
                            <select name="data[gender]" class="selectStyle">
                                <option value="">请选择</option>
                                <option value="0" <php>if(0==$info['gender']){</php> selected="selected" <php>}</php>>先生</option>
                                <option value="1" <php>if(1==$info['gender']){</php> selected="selected" <php>}</php>>女士</option>
                            </select>
                        </li>
                        <li>
                            <label><span style="color:Red">*</span>联系电话：</label>
                            <input type="text" class="inputStyle width2" name="data[contact]" value="{$info.contact}" maxlength="10">
                        </li>

                        <li>需求信息</li>
                        <li>
                            <label>面积：</label>
                            <span style="float: left"><input type="text" class="inputStyle width2 input_test" name="data[area1]" maxlength="10" value="{$info.area1}"></span>
                            <span style="float: left; padding: 0 10px;">~</span>
                            <span style="float: left"><input type="text" class="inputStyle width2 input_test" name="data[area2]" maxlength="10" value="{$info.area2}" ></span>
                        </li>
                        <li>
                            <label>户型：</label>
                        <span style="float: left"><select name="data[need_type1]" class="selectStyle">
                            <option value="">请选择</option>
                            <option value="1" <php>if(1==$info['need_type1']){</php> selected="selected" <php>}</php>>一室</option>
                            <option value="2" <php>if(2==$info['need_type1']){</php> selected="selected" <php>}</php>>二室</option>
                            <option value="3" <php>if(3==$info['need_type1']){</php> selected="selected" <php>}</php>>三室</option>
                            <option value="4" <php>if(4==$info['need_type1']){</php> selected="selected" <php>}</php>>四室</option>
                            <option value="5" <php>if(5==$info['need_type1']){</php> selected="selected" <php>}</php>>五室</option>
                            <option value="6" <php>if(6==$info['need_type1']){</php> selected="selected" <php>}</php>>六室</option>
                            <option value="7" <php>if(7==$info['need_type1']){</php> selected="selected" <php>}</php>>七室</option>
                            <option value="8" <php>if(8==$info['need_type1']){</php> selected="selected" <php>}</php>>八室</option>
                            <option value="9" <php>if(9==$info['need_type1']){</php> selected="selected" <php>}</php>>九室</option>
                        </select></span>
                            <span style="float: left; padding: 0 10px;">~</span>
                        <span style="float: left"><select name="data[need_type2]" class="selectStyle">
                            <option value="">请选择</option>
                            <option value="1" <php>if(1==$info['need_type2']){</php> selected="selected" <php>}</php>>一室</option>
                            <option value="2" <php>if(2==$info['need_type2']){</php> selected="selected" <php>}</php>>二室</option>
                            <option value="3" <php>if(3==$info['need_type2']){</php> selected="selected" <php>}</php>>三室</option>
                            <option value="4" <php>if(4==$info['need_type2']){</php> selected="selected" <php>}</php>>四室</option>
                            <option value="5" <php>if(5==$info['need_type2']){</php> selected="selected" <php>}</php>>五室</option>
                            <option value="6" <php>if(6==$info['need_type2']){</php> selected="selected" <php>}</php>>六室</option>
                            <option value="7" <php>if(7==$info['need_type2']){</php> selected="selected" <php>}</php>>七室</option>
                            <option value="8" <php>if(8==$info['need_type2']){</php> selected="selected" <php>}</php>>八室</option>
                            <option value="9" <php>if(9==$info['need_type2']){</php> selected="selected" <php>}</php>>九室</option>
                        </select></span>
                        </li>
                        <li>
                            <label>朝向：</label>
                            <select name="data[orientations]" class="selectStyle">
                                <option value="">请选择</option>
                                <option value="1" <php>if(1==$info['orientations']){</php> selected="selected" <php>}</php>>东</option>
                                <option value="2" <php>if(2==$info['orientations']){</php> selected="selected" <php>}</php>>南</option>
                                <option value="3" <php>if(3==$info['orientations']){</php> selected="selected" <php>}</php>>西</option>
                                <option value="4" <php>if(4==$info['orientations']){</php> selected="selected" <php>}</php>>北</option>
                                <option value="5" <php>if(5==$info['orientations']){</php> selected="selected" <php>}</php>>东南</option>
                                <option value="6" <php>if(6==$info['orientations']){</php> selected="selected" <php>}</php>>西南</option>
                                <option value="7" <php>if(7==$info['orientations']){</php> selected="selected" <php>}</php>>西北</option>
                                <option value="8" <php>if(8==$info['orientations']){</php> selected="selected" <php>}</php>>东北</option>
                                <option value="9" <php>if(9==$info['orientations']){</php> selected="selected" <php>}</php>>南北</option>
                                <option value="10" <php>if(10==$info['orientations']){</php> selected="selected" <php>}</php>>东西</option>
                                <option value="11" <php>if(11==$info['orientations']){</php> selected="selected" <php>}</php>>其它</option>
                            </select>
                        </li>
                        <li>
                            <label>价格：</label>
                            <span style="float: left;"><input type="text" class="inputStyle width2 input_test" name="data[price1]" maxlength="10" value="{$info.price1}" ></span>
                            <span style="float: left; padding: 0 10px;">~</span>
                            <span style="float:left;"><input type="text" class="inputStyle width2 input_test" name="data[price2]" maxlength="10" value="{$info.price2}" ></span>
                        </li>
                        <li>
                            <label>楼层：</label>
                            <span style="float: left; padding: 0px;"><input type="text" class="inputStyle width2 input_test" name="data[fool_scope1]" maxlength="10" value="{$info.fool_scope1}" ></span>
                            <span style="float: left; padding: 0 10px;">~</span>
                            <span style="float: left; padding: 0px;"><input type="text" class="inputStyle width2 input_test" name="data[fool_scope2]" maxlength="10" value="{$info.fool_scope2}" ></span>
                        </li>
                        <li>
                            <label>总楼层：</label>
                            <select name="data[fool_total]" class="selectStyle">
                                <option value="0">不限</option>
                                <option value="1"  <php>if(1==$info['fool_total']){</php> selected="selected" <php>}</php>>楼梯房（小于等于8层）</option>
                                <option value="2"  <php>if(2==$info['fool_total']){</php> selected="selected" <php>}</php>>电梯房（大于8层）</option>
                            </select>
                        </li>
                        <li>
                            <label>状态：</label>
                            <select name="data[state]" class="selectStyle">
                                <option value="">请选择</option>
                                <option value="1"  <php>if(1==$info['state']){</php> selected="selected" <php>}</php>>有效</option>
                                <option value="2"  <php>if(2==$info['state']){</php> selected="selected" <php>}</php>>资料</option>
                                <option value="3"  <php>if(3==$info['state']){</php> selected="selected" <php>}</php>>成交</option>
                                <option value="4"  <php>if(4==$info['state']){</php> selected="selected" <php>}</php>>暂停</option>
                                <option value="5"  <php>if(5==$info['state']){</php> selected="selected" <php>}</php>>回收</option>
                            </select>
                        </li>
                        <li>
                            <label>小区：</label>
                            <!--div id="estate">
                                <input type="text" id="estate_id" class="inputStyle width2 input_test" name="data[estate_id]" maxlength="10" value="{$info.estate_id}" >
                                <div id="show_message" name="show_message"></div></div-->
                            <select id="estate_id" name="data[estate_id]"></select>
                            <input type="hidden" id="estate_hide"  value="{$info.estate_id}" >

                            <input type="checkbox" id="around" <php>if(1==$info['around']){</php> checked="checked" <php>}</php> class="inputStyle width2" style="margin: 3px 5px 0 25px; padding: 0; width: 20px;"  name="data[around]" maxlength="10" value="1">周边
                        </li>
                        <li>
                            <label>备注：</label>
                            <input type="text" class="inputStyle width2 input_test" name="data[remark]" maxlength="10" value="{$info.remark}" >
                        </li>
                        <li>
                            <label></label>
                            <input type="submit" name="submit" value="提 交" class="btnStyle">
                        </li>
                        <li>跟进信息</li>
                        <volist name="follow_info" id='vo'>
                            <ul>
                                <li>
                                    <label>跟进人：</label>
                                    {$vo.user_id}
                                </li>
                                <li>
                                    <label>跟进时间：</label>
                                   {$vo.add_time}
                                </li>
                                <li>
                                    <label>跟进信息：</label>
                                    {$vo.discuss}
                                </li>
                            </ul>
                        </volist>
                    </ul>
                </div>
            </form>
        </div>
    </div>
</div>
<js file="__S__/ueditor/ueditor.config.js" charset="utf-8" />
<js file="__S__/ueditor/ueditor.all.min.js" charset="utf-8" />
<js file="__S__/ueditor/lang/zh-cn/zh-cn.js" charset="utf-8" />
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__STATIC__/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
    }
    var ue = UE.getEditor('info', {
        toolbars: [[
            'fullscreen', 'source', '|',
            'bold', 'italic', 'underline', '|', 'fontfamily','fontsize', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', 'simpleupload','|', 'kityformula', 'preview'
        ]]
    });
</script>
<script src="__S__/js/jquery.validate.js"></script>
<script type="text/javascript">
    $(function(){
        $("#info_form").validate({
            rules: {
                title: {
                    required: true,
                    minlength: 2
                }
            },
            messages: {
                title: {
                    required: "请输入文章标题",
                    minlength: "文章标题一定要两个字以上"
                }
            }
        });
    });

    $(function(){

        $('#info_form').find('input,textarea,select,submit').attr('disabled',true);
        $('input[name="submit"]').hide();

        $("input[class*=input_test]").each(function(){
            var oldVal=$(this).val();   //默认的提示性文本
            $(this).css({"color":"#888"})  //灰色
                    .focus(function(){
                        if($(this).val()!=oldVal){$(this).css({"color":"#000"})}else{$(this).val("").css({"color":"#888"})}
                    })
                    .blur(function(){
                        if($(this).val()==""){$(this).val(oldVal).css({"color":"#888"})}
                    })
                    .keydown(function(){$(this).css({"color":"#000"})})

        })


        //小区数据加载
        loadEstate();
    })

    function loadEstate(){
        var temp = $("#estate_hide").val();
        $.ajax({
            type: 'POST',
            url:"user.php?m=Member&c=Cust&a=searchEstate",
            //data:{'searchValue':searchValue},
            dataType: 'json',
            success: function(jsonData) {
                var json_data=eval("("+jsonData+")");
                //alert(json_data.list[0].id);
                var html = "<option>请选择</option>";
                for(var i=0;i<json_data.count;i++){
                    if(temp == json_data.list[i].id){
                        html += '<option selected value="'+json_data.list[i].id+'">'+json_data.list[i].title+'</option>';
                    }else{
                        html += '<option value="'+json_data.list[i].id+'">'+json_data.list[i].title+'</option>';
                    }

                }
                $("#estate_id").append(html);
                //$("#show_message").show();
                //$("#show_message").html(html+"</>");
                //$("#show_message").fadeOut(10000);
                return false;
            },//end success
            error:function(XMLHttpRequest, textStatus, errorThrown){
                alert("数据加载失败");
            }
        });
    }
</script>
<include file="Public:footer" />